package com.weixin.controller;

import java.util.List;

import com.alibaba.fastjson.JSONObject;
import com.jfinal.core.Controller;
import com.weixin.dao.City;
import com.weixin.utils.DateUtils;

public class CityController extends Controller{
	public City dao = new City();
	
	public void index(){

	}
	
	/**
	 * 通过省份id选择城市
	 */
	public void selectAll(){
		String province_id = getPara("province_id");
		List<City> citys = dao.selectAll(province_id);
		JSONObject json = new JSONObject();
		if (citys.size() == 0) {
			json.put("code", 0);
		}else{
			json.put("code", "1");
			json.put("data", citys);
		}
		renderJson(json);
	}
	
}
